#include <stdlib.h>
#define begin() begin
#define end() end
typedef struct vector vector;
struct vector{
       int *val;
       int begin,end,type;
};
void vector_push_back(vector *base,int i){
     if ((*base).begin==0)
        (*base).begin=1;
     ++((*base).end);
     (*base).val=(int*)realloc((*base).val,((*base).type) * ((*base).end+1));
     (*base).val[(*base).end()]=i;
}
void vector_setsize(vector *base,int size){
     (*base).type=size;
}
void vector_delete(vector *base,int val){
     if ((*base).end>=val)
        (*base).end-=val;
     else
         (*base).end=0;
}
void prvec(vector base){
     int i;
     for (i=base.begin;i<=base.end;++i)
         printf("%d ",base.val[i]);
}
void prvecn(vector base,int left,int right){
     int i;
     for (i=left;i<=right;++i)
         printf("%d ",base.val[i]);
}
void vector_alloc(vector *base,int arg){
     (*base).val=(int*)realloc((*base).val,((*base).type) * (arg));
}
